<template>
	<!--pages/collageRules/collageRules.wxml-->
	<view v-if="rulesImg" class="rulesImg">
		<image :src="rulesImg" mode="widthFix"></image>
	</view>
</template>

<script>
	// pages/collageRules/collageRules.js
	var app = getApp().globalData;

	export default {
		data() {
			return {
				rulesImg: ''
			};
		},

		components: {},
		props: {},

		/**
		 * 生命周期函数--监听页面加载
		 */
		async onLoad(options) {
			await this.$onLaunched;
			// #ifdef MP-ALIPAY
			if (JSON.stringify(options) == '{}') {
				options = my.getLaunchOptionsSync().query;
			}
			// #endif
			if (options && (options.store_id || options.storeid)) {
				this.$store.store_id = options.store_id ? options.store_id : options.storeid;
			}

			var that = this;
			uni.showLoading();
			getApp().globalData.sendRequest({
				url: '/Group/getRulesDetailsImg',
				type: "post",
				data: {},
				success: function(res) {
					if (res.status == 1) {
						that.setData({
							rulesImg: res.img
						});
						uni.hideLoading();
					} else {
						uni.hideLoading();
						uni.showToast({
							title: '获取失败',
							icon: 'none',
							duration: 1500,
							mask: true
						});
					}
				}
			});
		},

		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},

		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {},

		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function() {},

		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {},

		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {},

		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function() {},

		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {
			return {
				title: '玩法规则',
				path: '/pages/index/collageRules/collageRules?store_id' + this.$store.store_id +
					'&share_uid=' + app.XcxData.userInfo.uid,
				success: function(res) { // 转发成功
				},
				fail: function(res) { // 转发失败
				}
			};
		},
		methods: {}
	};
</script>
<style>
	@import "./collageRules.css";
</style>
